/**
*      author: Y_Yao
*      created: 2024-12-04 10:17:56
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 15 + 7;
int a[N],x[N],y[N];
bool vis[N];
int n;
int ans = INF;
vector<pair<int,int>> v;

void dfs(int count,int len,int cur)
{
    if(count == n)
    {
        ans = min(ans,len);
        return;
    }

    for(int i = 0;i < v.size();i++)
    {
        if(vis[i]) continue;
        vis[i] = true;
        dfs(count + 1,len + sqrt((v[cur].first - v[i].first) * (v[cur].first - v[i].first) + 
        (v[cur].second - v[i].second) * (v[cur].second - v[i].second)),i);
        vis[i] = false;
    }
}

bool cmp(pair<int,int> p1,pair<int,int> p2)
{
    return p1.first * p1.first + p1.second * p1.second < p2.first * p2.first + p2.second * p2.second;
}

void solve()
{
    cin >> n;
    v.push_back({0,0});
    for(int i = 1;i <= n;i++)
    {
        cin >> x[i] >> y[i];
        v.push_back({x[i],y[i]});
    }

    sort(v.begin(),v.end(),cmp);
    dfs(0,0,0);
    cout << ans << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}